(* Content-type: application/vnd.wolfram.mathematica *)

(*** Wolfram Notebook File ***)
(* http://www.wolfram.com/nb *)

(* CreatedBy='Mathematica 8.0' *)

(*CacheID: 234*)
(* Internal cache information:
NotebookFileLineBreakTest
NotebookFileLineBreakTest
NotebookDataPosition[       157,          7]
NotebookDataLength[     24562,        483]
NotebookOptionsPosition[     23687,        453]
NotebookOutlinePosition[     24032,        468]
CellTagsIndexPosition[     23989,        465]
WindowFrame->Normal*)

(* Beginning of Notebook Content *)
Notebook[{

Cell[CellGroupData[{
Cell[TextData[{
 "GearClutch\n",
 StyleBox["Gear connected with a clutch",
  FontSize->16]
}], "Section",
 CellChangeTimes->{{3.51923891821875*^9, 3.5192389314375*^9}, {
  3.52260437209375*^9, 3.522604381546875*^9}, {3.5719332667423162`*^9, 
  3.57193327444873*^9}}],

Cell[BoxData[
 RowBox[{"<<", "C:\\\\Hopsan\\Compgen\\CompgenNG.mx"}]], "Input",
 CellChangeTimes->{{3.5772037650720577`*^9, 3.5772037650780582`*^9}, {
  3.611474457184202*^9, 3.611474523938877*^9}, {3.6114745588913717`*^9, 
  3.61147456057154*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"path", "=", 
   RowBox[{"ToFileName", "[", 
    RowBox[{"{", 
     RowBox[{
     "\"\<C:\>\"", ",", "\"\<HopsanTrunk\>\"", ",", 
      "\"\<ComponentLibraries\>\"", ",", "\"\<defaultLibrary\>\"", ",", 
      "\"\<Mechanic\>\"", ",", "\"\<Rotational\>\""}], "}"}], "]"}]}], 
  ";"}]], "Input",
 CellChangeTimes->{{3.5757727777685804`*^9, 3.575772792541806*^9}, {
   3.5757728423954945`*^9, 3.5757728498367076`*^9}, {3.57577333888545*^9, 
   3.5757733706315055`*^9}, 3.5757734316206255`*^9, 3.6031909973287797`*^9, 
   3.6057717887213297`*^9, {3.605771829393656*^9, 3.605771830929744*^9}, 
   3.6058530990363216`*^9, {3.621138851005574*^9, 3.621138863716845*^9}, {
   3.626686112671085*^9, 3.6266861209310846`*^9}, {3.6273758738899097`*^9, 
   3.627375907312579*^9}, {3.6278060251438417`*^9, 3.627806031567667*^9}}],

Cell[TextData[{
 "Gear connectedto a clutch.\n\n",
 Cell[GraphicsData["Metafile", "\<\
CF5dJ6E]HGAYHf4PEfU^I6mgLb15CDHPAVmbKF5d0@0002;X0@000?@0003JoOoof_goofH200170P00
00000000003Z2000U@@00215CDH00040j28003L100030000@`0006`000000000EPD00003003R0@00
3`40000000000000000006IJ1`1E8P@0B@1^06/0L`1S0640L01U0200<00^03@0>00^0380801b03T0
>00a03T0800X0440M@1W0200<@0d0200<P0`0340<@0Y0000J@1^06/0L`1S0640L01U02d0H`1/06T0
L01R06l0H@1b06@0;@1U07P0L01_0780M00^06D0K@1V000000000140000<0000200000T0000@0000
jPP009D4000;000040000400000Q0000AP0002P0000L0000Df=bIFE^?C4c=SIh=cHhL7P/83@h<WPb
=c5]KDH0000<1000oP<004AbHGMYKVLm<2h`N2df=S0h<3Ta<30c=c<d=c0`<30i<SLg=3He=3<i<c@a
=C@b=cHg<CTb<cP`<3Pe<S<f<c@a<c@c<CLa=S8`<S4i=3Lc<S0g=38e<CDd=3Ha>CTa<38a>C8e<C@i
<C@c>CHh>C@h<CL`=SD`=3@e<c4f>C0f>C<b=CTf=CHd=c8g<CL`>CT`=3@h<CD`<SPe<C0g=3@h<CTf
>34`>CPc<CDg>C4g>3Tg=C@f<c0b=c8g>C0f=C4d<CLi<ST`<cPd=c8d=30e>30a=c8`<3@a=c@i<3<i
<cDa<SLi<cLi<S@h<3@c<3Hb<c0d>CHe>3Ta<c<c=3Ld=STh=C0e=3Pf>3Lh>C8`=c<h=CPc>CLe>3Pa
<C4e=S4i=C@h=C0f=CDa=3Th<c0i=3<i=S8f=cLd<cT`>3Ha<S0c=34a<3Da=cDb=30i<CHb=CDc=S<`
>CHg>CHh=3Th=C4e=CTe=c0g<C0a<3Hb=S0h<3Lc=S0d=c8c<30e=C0e<cHa=34c=38h>3<i<S8a>34b
=30i=3Te<c0i<cDh=S8`=S0e>3Pi>38`>3Pe>30g<3<`<C0c<3Hf<cHf>3Dh=c@i<3Tf=3Ti<c<e<3Tf
=3De<C@g<SHe=cTg=S<d=CPd=CDd<3Lh>3Hh<3Pe=c8`>34c<3<a<c0e<C0g=3D`=cTh<c@a>C0c>38b
>C@c<c8a=3H`<S@`>3Tg=CT`<3Dh=3<g=ST`=SPe<S@g<3@g=CHe=CHd=3@a<S<e<cLf<3Dh>CLg=3Hb
=c0f=3Pi=S0i=3Dg<C8e=C@f<3Pa<S<a<S8`=c4i>CLf<STa<cHa=3L`=c0h<cHh<S@e<C0d=SPa<SHe
<S@d=3<d>C@b>C4e<STh=S0i=3L`<CPf>3P`<cDd=S@e<c4b=3Tf>C0h>34f<cP`=CPe=cDb>CTh>C4f
<STe=S0h=C@h>CHc<SLf<S8g=C@`>3Ta=C0b=cLf>C0g<C@`<S<`=3Th<C<f<SDf=3Tb=S0g<S@h<cH`
=3@i<C<f=c@b=S@i=C4`>C4d<CHd>C4d<CDi<3@d<34e=c4g=C4f<SHi<SLa=SD`<c0g>3@a<CTa>3Db
<30f<C@e>CL`>3De=C4f<30e<cDb>3D`<3Dh>C4c<3@h<S@e<C@e<C<b<SHh=CHi=S@b=SHc=CH`>C0c
=S4i=34c>C<i<3Hc=cTg=S@c>CHf<SHb<S<`>34f<SDd=c8f=STf=c8`<c8f<3L`<CDe=cPi=c@f<cLh
=c4c=CLc=3D`=c@d=c0d=C@c>30b=SLa<S@c<SDd>3Lh<CLf>C8a=c@a<C<`=c<e<S4g=c@`<SDb>3<i
<cTc=38g=C<h<3Tb=c@e>3Pf000W00006000004000000000oooo0000000U000030000040000C0000
30000080001O0000>0000080000h0000000003P000000000024102X0000000000000000000000000
000002D0000<00000P0003X0000<0000kP0003/0000800006`000100003E2000b`4003H0000@0000
LP800</1000f00004000078200310P00=P000100003E2000`@8003d000080000?00000P0000o0000
60000>_moooVoOooIP8003/2000U000030000000080X000030000040000U0000300000L0080X0000
30000080000W00006000008000000000oooo0000000U000030000080000C000030000080001O0000
>0000040000h0000000003P000000000024102X0000000000000000000000000000002D0000<0000
0@0003X0000<0000kP0003/0000800006`000100001;1`005P0003H0000@0000f0<001H0001H0000
:000000000000000ooooooooool30000Q0<F0403FP100jl0=P00010000100`00i`<005P0000X0000
00000000003oooooooooo`<000100c`4Q0>01=P3P0@f0000400004/700201000F00002P000000000
00000?oooooooooo0`000:07P0CT1c`4i0OW0cH0000@0000i0L00:l0001H0000:000000000000000
ooooooooool30000i0MJ0:075P1;1aH0?@0000P0000l0000200003l0000H0000l?goom[moomP0P00
A`8002D0000<00000000P2P0000<00000P0002D0000<00001`00P2P0000<00000@0002L0000H0000
0@00000000000000000002D0000<00000@0001<0000<00000P0003/0000800006`000100003d0`00
T@<003H0000@0000c`<00943000f000040000<l3001>0P00=P000100003g0`00CP8003H0000@0000
m`<00<42001H0000:000000000000000ooooooooool300001`B/0Qd4XP8g1:82F00002P000000000
00000?oooooooooo0`0004D4XP9C1:@2H0BZ0UP0000X000000000000003oooooooooo`<0001]1;02
M`Bh0X04``9H0000:000000000000000ooooooooool30000R0C=0Xh4fP:C1>T2F00002P000000000
00000?oooooooooo0`0009P4n0:J10L3VP@H0eP0000X000000000000003oooooooooo`<0002J1443
T0AP0g`4M@=H0000:000000000000000ooooooooool30000J0B;0e44UP<e19H3F00002P000000000
00000?oooooooooo0`0001T4UP<418/3m0=d0cd0000800006`000100003c0`006P<005P0000X0000
00000000003oooooooooo`<0003c0cH3m`=;0ol3E`=H0000:000000000000000ooooooooool30000
2`A[0a`4MP<b17H3F00002P00000000000000?oooooooooo0`0004<4MP=B16h3G`AO0eP0000X0000
00000000003oooooooooo`<0001[1503LP@j0g8470=H0000:000000000000000ooooooooool30000
LPCm0V/4i`9O1=P2F00002P00000000000000?oooooooooo0`0005<4b@951<82<`C20UP0000X0000
00000000003oooooooooo`<0000R1<824`C:0PH4f@9H0000:000000000000000ooooooooool30000
nP?X0_<3oP;c0aX3?@0000P0000l0000200003h0000H00006`000140000Q00006P0002D0000<0000
0000P2P0000<00000@0002L0000H00000@00000000000000000002D0000<00000@0001<0000<0000
0P0003/0000800006`000100002l100070<005P0000X000000000000003oooooooooo`<0002l1?42
b0C@0^04_09H0000:000000000000000ooooooooool30000m0BZ0Pd5XP8Z1J82F00002P000000000
00000?oooooooooo0`0004X5XP9T1J`2N@G10UP0000X000000000000003oooooooooo`<0002=1MH2
U`Gc0YL56@=H0000:000000000000000ooooooooool30000U`Dg0i<5CP>:1F03F00002P000000000
00000?oooooooooo0`000845L@=c1Gh3HPF80eP0000X000000000000003oooooooooo`<0001A1I83
?PFF0bX5UP=H0000:000000000000000ooooooooool300002@FF0nh4S0?J17L3F00002P000000000
00000?oooooooooo0`000<H4HP>l14<3_0@L0cd0000800006`000100003U100070<005P0000X0000
00000000003oooooooooo`<0003U13X3j`A@0oP4G`=H0000:000000000000000ooooooooool30000
1@E^0aH5MP<Z1GH3F00002P00000000000000?oooooooooo0`0003d5MP=>1Fh3F`EO0eP0000X0000
00000000003oooooooooo`<0001X1E03KPDi0fh56`=H0000:000000000000000ooooooooool30000
KPGn0VP5j09K1MT2F00002P00000000000000?oooooooooo0`0004h5bP8m1L82:PG20UP0000X0000
00000000003oooooooooo`<0000F1L821@G:0_P4f@9H0000:000000000000000ooooooooool30000
j`CX0^D4oP;U11`3?@0000P0000l0000200003h0000H00008P0001<0000X00006P0002D0000<0000
0000P2P0000<00000@0002L0000H00000@00000000000000000002D0000<00000@0001<0000<0000
0P0003/0000800006`000100002[1@00T@<003H0000@00000@H001L3000f000040000;85002W0P00
=P000100003T1@00Y`8003H0000@00001`H00=h2001H0000:000000000000000ooooooooool30000
3PKX0Q@6l@8H1_P2F00002P00000000000000?oooooooooo0`0001h6kP8T1^H2:PKN0SH0000@0000
D@H00:L2000f000040000806002W0P00=P000100000`1P005@<003H0000@0000Q`H00943000f0000
400005H6002A0`00=P000100000V1P00B0<003H0000@00006@H003D3000f000040000=`5002A0`00
?@0000P0000l0000200003h0000H0000:@0001<0000_00006P0002D0000<00000000P2P0000<0000
0@0002L0000H00000@00000000000000000002D0000<00000@0001<0000<00000P0003/000080000
6`000100001L1000G`4003H0000@0000G0@003X1000f000040000>D4000i0@00=P000100003U1000
/@4005P0000X000000000000003oooooooooo`<0003@1<81^`C?0J@4e`5H0000:000000000000000
ooooooooool30000SPCP0GL4i05O1>@1F00002P00000000000000?oooooooooo0`000404i04S1=d1
2@C?0EP0000X000000000000003oooooooooo`<0003_0l81f`>^0Lh3U05H0000:000000000000000
ooooooooool30000`@=k0KX3GP6j0ch1F00002P00000000000000?oooooooooo0`000;X37`710`41
cP?V05P0000X000000000000003oooooooooo`<0003K0l/0kP>g00L4Z@1H0000:000000000000000
ooooooooool300007`BL03`4U@1L19D0F00002P00000000000000?oooooooooo0`0007<4U@2919T0
V`BQ05P0000X000000000000003oooooooooo`<0002^1:P0_@Bc0<P4`01H0000:000000000000000
ooooooooool30000d`C>0=/4h03P1?D0=P000100002j1000004005P0000X000000000000003ooooo
ooooo`<0002e1?00[`CS0:P4f@1H0000:000000000000000ooooooooool30000X@C@09H4b0291<<0
F00002P00000000000000?oooooooooo0`0007/4_@1]1;X0G0Bj05P0000X000000000000003ooooo
ooooo`<000191;X0>0Bm02X4``1H0000:000000000000000ooooooooool300006`C90104d@071=X0
F00002P00000000000000?oooooooooo0`000?h3i03h0nl0l`?j05P0000X000000000000003ooooo
ooooo`<0003Z0`h1iP<T0NH3?05H0000:000000000000000ooooooooool30000iP=H0N/3L07e0h@1
F00002P00000000000000?oooooooooo0`000?l3U`4>1:H18@B_0EP0000X000000000000003ooooo
ooooo`<0000d1;P1B0Bm0Ed4_@5H0000:000000000000000ooooooooool30000K`Bm0H84^P6C1;81
F00002P00000000000000?oooooooooo0`000:D4Z`6b1:@1^`BL0CH0000@0000^`@005l1000m0000
200003`000080000?P0001P0000K0000100002<0000>00009@0000`000000020:00000`000010000
9`0001P00001000000000000000000009@0000`0000100004`0000`000020000>`0000P0000K0000
40000;l5002C0@00=P000100003X1@00V04005P0000X000000000000003oooooooooo`<0003R1K01
ePG20L@5d05H0000:000000000000000ooooooooool30000/`GM0Id5i0611N@1F00002P000000000
00000?oooooooooo0`0005l5i0541MT1<0G40EP0000X000000000000003oooooooooo`<0000L1Jl1
4PFA0A85J`5H0000:000000000000000ooooooooool300004PE40A`59@4`1@l1F00002P000000000
00000?oooooooooo0`0004@5nP1O1Nl0O`G_05P0000X000000000000003oooooooooo`<0002N1Nl0
^0Gi0<`53`5H0000:000000000000000ooooooooool30000h0DT0NX5@P7Z1FT1F00002P000000000
00000?oooooooooo0`000>X5J`7Z1Fl1j@Ec0CH0000@0000>`D007<1001H0000:000000000000000
ooooooooool30000?0F=0D@5X@5A1Jh1F00002P00000000000000?oooooooooo0`0005h5_05^1L<1
PPG30EP0000X000000000000003oooooooooo`<0002@1L<1W@Fo0JL5]`5H0000:000000000000000
ooooooooool30000/@F`0KT5Y06o1I<1?@0000P0000K0000400003d5001C0@00=P00010000301@00
D`4005P0000X000000000000003oooooooooo`<0002n1Cl1^@D`0K459P5H0000:000000000000000
ooooooooool30000Y0DG0I@53`601@l1F00002P00000000000000?oooooooooo0`0006d53`5N1AH1
DPDR0EP0000X000000000000003oooooooooo`<000151Bh1?PDn0Cd5D`4m0000200003`000080000
?P0001P0000T00001`0002X0000>00009@0000`000000020:00000`0000100009`0001P000010000
00000000000000009@0000`0000100004`0000`000020000>`0000P0000K000040000;<600310@00
F00002P00000000000000?oooooooooo0`000:@6cP6F1]L1R@KL0EP0000X000000000000003ooooo
ooooo`<0001k1^41K@KT0Ed6i05H0000:000000000000000ooooooooool30000@`KT0Bl6g@4R1]41
F00002P00000000000000?oooooooooo0`0001@6a04=1[@13@JP0EP0000X000000000000003ooooo
ooooo`<0000=1YD140J;0AD6P@5H0000:000000000000000ooooooooool300006PIh0B46L04Y1VX1
F00002P00000000000000?oooooooooo0`000386I@4k1V01APIM0EP0000X000000000000003ooooo
ooooo`<0001>1U/1F@II0FT6E`5H0000:000000000000000ooooooooool30000R@IC0J46C`6`1TX1
F00002P00000000000000?oooooooooo0`000;06A06`1T41/0Ho0EP0000X000000000000003ooooo
ooooo`<0002`1Rl1[0HT0JD67@5H0000:000000000000000ooooooooool30000V`HD0H`6405h1Q01
F00002P00000000000000?oooooooooo0`0006D6405G1Q<1CPHI0EP0000X000000000000003ooooo
ooooo`<000151R01?`H/0C/6?04f0000400001@6000g0@00F00002P00000000000000?oooooooooo
0`0001L69P4M1QT19@H?0EP0000X000000000000003oooooooooo`<0000]1P@1>@Km04P6m`1H0000
:000000000000000ooooooooool30000F0Kb06T6k`1m1^l0F00002P00000000000000?oooooooooo
0`000946k`2R1_40[PKf05P0000X000000000000003oooooooooo`<0002k1_/0a0H00LX6205H0000
:000000000000000ooooooooool30000d0H?0M@6607F1R<1F00002P00000000000000?oooooooooo
0`000=L6:@7H1SH1f0I70CH0000@0000f0H007`1001H0000:000000000000000ooooooooool30000
f0JQ0MT6^07K1/81F00002P00000000000000?oooooooooo0`000=`6c07P1]D1i@KN0CH0000@0000
^`H00=h1001H0000:000000000000000ooooooooool30000]`KF0K@6c06c1/41?@0000P0000K0000
40000;06001Y0@00F00002P00000000000000?oooooooooo0`000:46K`6<1W@1K`Ih0EP0000X0000
00000000003oooooooooo`<0001O1WX1D`Im0D`6P05H0000:000000000000000ooooooooool30000
APJ30D06Q`4m1Xd1F00002P00000000000000?oooooooooo0`0003T6TP4g1YP1=`JO0EP0000X0000
00000000003oooooooooo`<0000g1ZX1>`Jc0D<6^P5H0000:000000000000000ooooooooool30000
B`K10EL6a05V1/@1F00002P00000000000000?oooooooooo0`0007H6a0631/41S`Jj0EP0000X0000
00000000003oooooooooo`<0002K1[@1Y0J[0JT6W`5H0000:000000000000000ooooooooool30000
[PJF0K06R@6`1WL1?@0000P0000l0000200003h0000H0000:`0000L0000b00003P0002D0000<0000
0000P2P0000<00000@0002L0000H00000@00000000000000000002D0000<00000@0001<0000<0000
0P0003/0000800006`000100000E1`00gP4003H0000@00005@L00?@0000f0000400003T7003d0000
=P000100000i1`00604005P0000X000000000000003oooooooooo`<000121`L1B`Ol0587m`1H0000
:000000000000000ooooooooool30000FPOa0687k`1/1nl0F00002P00000000000000?oooooooooo
0`0007T7k`271o<0U0Ol03H0000@0000Q`L00201001H0000:000000000000000ooooooooool30000
O@LK0G<7605Z1aP1F00002P00000000000000?oooooooooo0`000647605I1aX1DPLP0EP0000X0000
00000000003oooooooooo`<0001;1bD1A`L/0D@7=@5H0000:000000000000000ooooooooool30000
?`M30Cd7D`4m1f@1=P000100000m1`00gP4003d000080000?00000P0000n0000600003<000070000
=P0000d0000U000030000000080X000030000040000W00006000004000000000oooo0000000U0000
30000040000C000030000080001O0000>0000080000h0000000003P000000000024102X000000000
0000000000000000000002D0000<00000P0003X0000<0000kP0003/0000800006`000100002L0@00
aP4003H0000@00005@000<H1000f0000400001D000360P00=P000100002L0@00aP8003d000080000
?00000P0000o000060000=[moooVoOoo<`8003/2000U000030000000080X000030000040000U0000
300000L0080X000030000080001O0000>0000080000h0000000003P000000000028102X000000000
0000000000000000000002D0000<00000P0003X0000<00006P4003/0000800006`000100002T0@00
T@0003H0000@0000Y0400=l3000l000020000400000H0000Dokood_nooo50@00e@4002D0000<0000
1`00P2P0000<00000P0005l0000h00000P0003P000000000>000000000008P40:P00000000000000
00000000000000009@0000`000020000>P0000`0000J0@00>`0000P0000K000040000742002A0000
=P000100001a0P00g`<003`000080000@00001P0001Io_ooBokool/1003E0@009@0000`000070020
:00000`0000200003P0001@000000000400001@0
\>"], "Graphics",
  GeneratedCell->False,
  CellAutoOverwrite->False,
  ImageSize->{208., 106.41860465116281`},
  ImageMargins->{{0, 0}, {0, 63}}],
 "\n"
}], "Text",
 CellChangeTimes->{{3.6278062207972603`*^9, 3.6278062259491367`*^9}, 
   3.6327767629109125`*^9, {3.632776821875285*^9, 3.632776891738281*^9}, {
   3.632776981707427*^9, 3.632777006875866*^9}, {3.632777042714916*^9, 
   3.632777078568967*^9}}],

Cell[BoxData[{
 RowBox[{
  RowBox[{"domain", "=", "\"\<Mechanic\>\""}], ";"}], "\n", 
 RowBox[{
  RowBox[{"displayName", "=", "\"\<GearClutch\>\""}], ";"}], "\n", 
 RowBox[{
  RowBox[{"brief", "=", "\"\<This is a combined clutch and gear\>\""}], 
  ";"}], "\n", 
 RowBox[{
  RowBox[{"componentType", "=", "\"\<ComponentQ\>\""}], ";"}], "\n", 
 RowBox[{
  RowBox[{"author", "=", "\"\<Petter Krus <petter.krus@liu.se>\>\""}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
  "affiliation", " ", "=", " ", 
   "\"\<Division of Fluid and Mechatronic Systems, Link\[ODoubleDot]ping \
University\>\""}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"SetFilenames", "[", 
   RowBox[{"path", ",", "domain", ",", "displayName"}], "]"}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"ResetComponentVariables", "[", "]"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{"Date", "[", "]"}]}], "Input",
 CellChangeTimes->{{3.5137112151875*^9, 3.513711217109375*^9}, {
   3.51378596903125*^9, 3.513785980671875*^9}, 3.515394539753217*^9, {
   3.515775693875*^9, 3.5157757050625*^9}, {3.517048046727305*^9, 
   3.51704806093043*^9}, 3.51707206725*^9, {3.5176530686834764`*^9, 
   3.51765311057437*^9}, {3.517673126703125*^9, 3.517673126796875*^9}, {
   3.5177214423487377`*^9, 3.517721453114225*^9}, {3.5177222281793466`*^9, 
   3.517722236008023*^9}, {3.5209603293125*^9, 3.520960329578125*^9}, 
   3.521782180515625*^9, {3.6065785375238237`*^9, 3.606578541434047*^9}, 
   3.60658042848398*^9}],

Cell[BoxData[
 RowBox[{
  RowBox[{"inputParameters", "=", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{
      "Jg", ",", "1.", ",", "double", ",", "\"\<kg\>\"", ",", 
       "\"\<Equivalent inertia at port 2\>\""}], "}"}], ",", 
     RowBox[{"{", 
      RowBox[{
      "Bg", ",", "0.", ",", "double", ",", "\"\<Ns/m\>\"", ",", 
       "\"\<Visc friction coeff. at port 2\>\""}], "}"}], ",", 
     "\[IndentingNewLine]", 
     RowBox[{"{", 
      RowBox[{
      "myfric", ",", ".01", ",", "double", ",", "\"\<\>\"", ",", 
       "\"\<friction. coeff. of gear (at output)\>\""}], "}"}], ",", 
     "\[IndentingNewLine]", 
     RowBox[{"{", 
      RowBox[{
      "wc", ",", "1.", ",", "double", ",", "\"\<rad/s\>\"", ",", 
       "\"\<Friction speed (for numerics)\>\""}], "}"}]}], 
    "\[IndentingNewLine]", "}"}]}], ";"}]], "Input",
 CellChangeTimes->{{3.5177223027002172`*^9, 3.5177223072630386`*^9}, 
   3.5177223927213974`*^9, {3.5177288124589844`*^9, 3.5177288192870655`*^9}, {
   3.519192018484375*^9, 3.5191920904375*^9}, {3.550729794796875*^9, 
   3.55072979915625*^9}, {3.6065544930052547`*^9, 3.6065544942132545`*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"inputVariables", "=", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{
      "gearRatio", ",", "1.", ",", "double", ",", "\"\<\>\"", ",", 
       "\"\<gear ratio wmr1/wmr2\>\""}], "}"}], ",", "\[IndentingNewLine]", 
     RowBox[{"{", 
      RowBox[{
      "tmax", ",", "500.", ",", "double", ",", "\"\<Nm\>\"", ",", 
       "\"\<Max torque\>\""}], "}"}]}], "}"}]}], ";"}]], "Input",
 CellChangeTimes->{{3.51879195675*^9, 3.51879195675*^9}, {
   3.5188418205557637`*^9, 3.5188418228369703`*^9}, 3.5191918769375*^9, {
   3.519191990234375*^9, 3.519191990515625*^9}, 3.51919202534375*^9, 
   3.519237145265625*^9, {3.519239074625*^9, 3.5192390884375*^9}, 
   3.6278059664500275`*^9}],

Cell[BoxData[
 RowBox[{
  RowBox[{"nodeConnections", "=", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"MechanicRotQnode", "[", 
      RowBox[{
      "mr1", ",", "0.", ",", "0.", ",", 
       "\"\<mechanical rotation node 1\>\""}], "]"}], ",", 
     RowBox[{"MechanicRotQnode", "[", 
      RowBox[{
      "mr2", ",", "0.", ",", "0.", ",", 
       "\"\<mechanical rotation node 2\>\""}], "]"}]}], "}"}]}], 
  ";"}]], "Input",
 CellChangeTimes->{{3.517722088982048*^9, 3.5177221000453267`*^9}, {
   3.5177226071005135`*^9, 3.51772269952388*^9}, {3.517728739896949*^9, 
   3.517728741256315*^9}, {3.5177288566774516`*^9, 3.517728859177436*^9}, {
   3.51811161153125*^9, 3.518111612828125*^9}, {3.5187902193125*^9, 
   3.51879021984375*^9}, 3.518796081296875*^9, {3.521780838296875*^9, 
   3.52178083940625*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"Tg", "=", 
   RowBox[{"(", 
    RowBox[{
     RowBox[{"gearRatio", " ", "tormr1"}], "+", "tormr2"}], ")"}]}], 
  ";"}]], "Input",
 CellChangeTimes->{{3.550726511265625*^9, 3.550726529125*^9}, {
  3.550727061046875*^9, 3.5507270635*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"systemEquationsDA", ":=", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{
      RowBox[{
       RowBox[{"Jg", " ", 
        RowBox[{"Der", "[", "wmr2", "]"}]}], "+", 
       RowBox[{"Bg", " ", "wmr2"}]}], "==", 
      RowBox[{"(", 
       RowBox[{
        RowBox[{"gearRatio", " ", "tormr1"}], "-", "tormr2"}], ")"}]}], ",", 
     "\[IndentingNewLine]", 
     RowBox[{
      RowBox[{"Der", "[", "thetamr2", "]"}], "==", "wmr2"}], ",", 
     "\[IndentingNewLine]", 
     RowBox[{
      RowBox[{"Der", "[", "thetamr1", "]"}], "\[Equal]", 
      RowBox[{
       RowBox[{"-", "gearRatio"}], " ", "wmr2"}]}]}], "}"}]}], ";"}]], "Input",
 CellChangeTimes->{{3.5177219982634974`*^9, 3.5177220614345636`*^9}, 
   3.5177223966277223`*^9, {3.5177281220102787`*^9, 3.517728126182127*^9}, {
   3.5191918265*^9, 3.519191848109375*^9}, {3.5719326407705774`*^9, 
   3.5719326469793887`*^9}, 3.6065781234251385`*^9, {3.60732012213516*^9, 
   3.607320122482195*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"systemEquationsDA", ":=", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{
      RowBox[{
       RowBox[{"Jg", " ", 
        RowBox[{"Der", "[", "wmr2", "]"}]}], "+", 
       RowBox[{"Bg", " ", "wmr2"}]}], "==", "Tg"}], ",", 
     "\[IndentingNewLine]", 
     RowBox[{
      RowBox[{"Der", "[", "thetamr2", "]"}], "==", "wmr2"}], ",", 
     "\[IndentingNewLine]", 
     RowBox[{
      RowBox[{"Der", "[", "thetamr1", "]"}], "\[Equal]", 
      RowBox[{
       RowBox[{"-", "gearRatio"}], " ", "wmr2"}]}]}], "\[IndentingNewLine]", 
    "}"}]}], ";"}]], "Input",
 CellChangeTimes->{{3.5177219982634974`*^9, 3.5177220614345636`*^9}, 
   3.5177223966277223`*^9, {3.5177281220102787`*^9, 3.517728126182127*^9}, {
   3.5191918265*^9, 3.519191848109375*^9}, {3.550558095859375*^9, 
   3.55055813553125*^9}, 3.550726445296875*^9, 3.550726507125*^9, 
   3.550726804953125*^9, {3.57193268744586*^9, 3.5719326993381195`*^9}, {
   3.6073190906270103`*^9, 3.6073191076237097`*^9}, {3.607319174019348*^9, 
   3.6073191752794743`*^9}, 3.607319273612821*^9, 3.607319745436821*^9, 
   3.6073201317061167`*^9}],

Cell[BoxData[
 RowBox[{
  RowBox[{"systemBoundaryEquations", "=", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"tormr1", "==", 
      RowBox[{"cmr1", "-", 
       RowBox[{"Zcmr1", " ", "gearRatio", " ", "wmr2"}]}]}], ",", 
     "\[IndentingNewLine]", 
     RowBox[{"tormr1", "==", 
      RowBox[{"cmr1", "+", 
       RowBox[{"Zcmr1", " ", "wmr1"}]}]}], ",", "\[IndentingNewLine]", 
     RowBox[{"tormr2", "==", 
      RowBox[{"cmr2", "+", 
       RowBox[{"Zcmr2", " ", "wmr2"}]}]}]}], "\[IndentingNewLine]", "}"}]}], 
  ";"}]], "Input",
 CellChangeTimes->{{3.517721974435677*^9, 3.517721983466811*^9}, {
   3.517738409847971*^9, 3.5177384690350924`*^9}, {3.517738575050039*^9, 
   3.517738580612503*^9}, 3.51919185296875*^9, {3.5505581591875*^9, 
   3.550558165390625*^9}, {3.5719327043301287`*^9, 3.5719327498042088`*^9}, {
   3.6073189342583747`*^9, 3.6073189416651154`*^9}, {3.607319256731821*^9, 
   3.6073192707468214`*^9}, {3.607415415653761*^9, 3.6074154169167604`*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"expressions", "=", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"eqInertiamr1", "==", 
      FractionBox["Jg", 
       SuperscriptBox["gearRatio", "2"]]}], ",", "\[IndentingNewLine]", 
     RowBox[{"eqInertiamr2", "==", "Jg"}]}], "\[IndentingNewLine]", "}"}]}], 
  ";"}]], "Input",
 CellChangeTimes->{
  3.517721656955366*^9, {3.517721741704281*^9, 3.517721748547943*^9}, 
   3.5177222002242537`*^9, 3.5191918551875*^9, {3.521913991796875*^9, 
   3.5219140115*^9}, {3.571932718120553*^9, 3.5719327357953835`*^9}, {
   3.606554554921254*^9, 3.6065545806732545`*^9}, 3.607320594762418*^9}],

Cell[BoxData[
 RowBox[{
  RowBox[{"variableLimits", "=", 
   RowBox[{"{", 
    RowBox[{"{", 
     RowBox[{"tormr1", ",", 
      RowBox[{"-", "tmax"}], ",", "tmax"}], "}"}], "}"}]}], ";"}]], "Input",
 CellChangeTimes->{{3.55055796390625*^9, 3.5505580105*^9}, {
   3.550558184609375*^9, 3.5505582028125*^9}, {3.55055829021875*^9, 
   3.55055834353125*^9}, 3.550726474515625*^9}],

Cell[BoxData[
 RowBox[{
  RowBox[{"systemVariables", "=", 
   RowBox[{"{", 
    RowBox[{
    "wmr2", ",", "thetamr2", ",", "thetamr1", ",", "tormr1", ",", "wmr1", ",",
      "tormr2"}], "}"}]}], ";"}]], "Input",
 CellChangeTimes->{{3.517728154744444*^9, 3.5177282181034136`*^9}, {
  3.607319289007821*^9, 3.607319292535821*^9}}],

Cell[BoxData[
 RowBox[{"Compgen", "[", "file", "]"}]], "Input"]
}, Open  ]]
},
WindowSize->{787, 742},
WindowMargins->{{Automatic, 139}, {Automatic, -15}},
FrontEndVersion->"8.0 for Microsoft Windows (64-bit) (October 6, 2011)",
StyleDefinitions->"Default.nb"
]
(* End of Notebook Content *)

(* Internal cache information *)
(*CellTagsOutline
CellTagsIndex->{}
*)
(*CellTagsIndex
CellTagsIndex->{}
*)
(*NotebookFileOutline
Notebook[{
Cell[CellGroupData[{
Cell[579, 22, 266, 7, 92, "Section"],
Cell[848, 31, 248, 4, 31, "Input"],
Cell[1099, 37, 848, 16, 52, "Input"],
Cell[1950, 55, 12606, 163, 172, "Text"],
Cell[14559, 220, 1496, 33, 192, "Input"],
Cell[16058, 255, 1169, 27, 132, "Input"],
Cell[17230, 284, 754, 17, 72, "Input"],
Cell[17987, 303, 830, 19, 72, "Input"],
Cell[18820, 324, 271, 8, 31, "Input"],
Cell[19094, 334, 1004, 25, 92, "Input"],
Cell[20101, 361, 1145, 26, 112, "Input"],
Cell[21249, 389, 999, 21, 112, "Input"],
Cell[22251, 412, 644, 14, 124, "Input"],
Cell[22898, 428, 376, 9, 31, "Input"],
Cell[23277, 439, 328, 8, 31, "Input"],
Cell[23608, 449, 63, 1, 31, "Input"]
}, Open  ]]
}
]
*)

(* End of internal cache information *)
